
module libeventd.defer.Internal;

import libeventd.Types;


extern(C):
struct deferred_cb {
	TAILQ_ENTRY!(deferred_cb) 	cb_next;
	ubyte	queued; 
	deferred_cb_fn	cb;
	void*	arg;
}
struct deferred_cb_queue {
	void*	lock;
	int	active_count;
	void function(deferred_cb_queue*, void*)	notify_fn;
	void*	notify_arg;
	TAILQ_ENTRY!(deferred_cb) deferred_cb_list;
}

alias void function(deferred_cb*, void*) deferred_cb_fn ;


void event_deferred_cb_init( deferred_cb *, deferred_cb_fn, void *);
void event_deferred_cb_cancel( deferred_cb_queue *,  deferred_cb *);
void event_deferred_cb_schedule( deferred_cb_queue *,  deferred_cb *);
void event_deferred_cb_queue_init( deferred_cb_queue *);
deferred_cb_queue *event_base_get_deferred_cb_queue( event_base *);


